Flow
Before creating a new IoT Flow instance, ensure that at least one connection resource is available. Follow the steps here to create a connection.
Create a New IoT Flow instance
Prerequisites
To create your new IoT Flow resource, fill in the following parameters:
- ID of the connector type (like
actility-aws-iot
) - ID of the connection resource instance to be used with the new IoT Flow instance.
Optionally, you can specify a driver ID for encoding and decoding payloads.
To use drivers, set the id
property within the driver
object of the Flow configuration.
There are two options:
- If set to
actility:auto:1
, IoT Flow will look for theDriverCfg
field within the message to perform encoding/decoding. IfDriverCfg
is not present, no encoding/decoding is done. - Alternatively, specify a static driver ID to enforce the use of a specific driver. Driver IDs can be found in the
id
field ofdriver
objects.
If the driver ID is not set or does not exist in the system, encoding/decoding is disabled.
Example
POST /flows
{
"name":"Test Flow",
"description":"This is a flow of test",
"driver":{
"id":"actility:auto:1"
},
"matchers":[
{
"type":"thing",
"tags":[
"TemperatureService",
"MyBestCustomer"
]
},
{
"type":"key",
"key":"lora:0018b20000000b20"
}
],
"connectors":[
{
"id":"actility-aws-iot",
"connectionId":"1",
"uplinkTimeValidity":"24h"
}
]
}
Flow Matcher
Refer to Creating a flow by UI for more information.
Example
"matchers":[
{
"type":"thing",
"tags":[
"TemperatureService",
"MyBestCustomer"
]
},
{
"type":"key",
"key":"lora:0018b20000000b20"
}
]
Uplink Validity
In some specific situation, it might happen that the communication between your Device and the cloud platform is lost.
Depending on the duration of such outage, it might not be relevant to send all sensor data sent during the outage to the IoT cloud platform.
If this applies to your application, you can check the uplink validity prior to sending the uplink messages to the connection.
Inside your flow configuration, in the connectors section, you can find a property named uplinkTimeValidity:
To manage this, you can define an uplink validity period in your flow configuration. Within the connectors section, use the uplinkTimeValidity
property:
"connectors": [
{
"id": "actility-aws-iot",
"connectionId": "1",
"uplinkTimeValidity": "24h"
}
]
In this example, if an uplink message is older than 24 hours, it will not be forwarded to the cloud platform when the connection recovers and an alarm event is saved in the events
log.
The uplink age is computed as the difference between the 2 following timestamps
- Time of arrival of the message in IoT flow process.
- Time of emission of the message from the LoRaWAN® Base Station.